<?php

class SubscriberActionController  {
	
	public static function eventHandler ($event)  {
		switch ($event[0])  {
			case 'delete':
				self::deleteSubscriber();
				break;
			case 'edit':
				self::editSubscriber($event[1]);
				break;
			case 'insert':
				self::insertSubscriber();
				break;
		}
	}
	
	private static function deleteSubscriber ()  {
		$table = 'tx_ttnewsletter_subscriber';
		$columnsToChange = array('deleted' => true);
		$condition = array('uid' => $_POST['uid']);		
		$condition = DBProcessor_DBElements::andConcat($condition);
		
		DBProcessor_DBElements::deleteData($table, $condition);
		
		SubscriberController::getSubscribers();
	}
	
	private static function editSubscriber ($subscriberUid)  {
		SubscriberController::getEditSubscriber($subscriberUid);
	}
	
	private static function insertSubscriber ()  {
		SubscriberController::getInsertSubscriber();
	}
	
}